package com.ulife.order.components;

import com.ulife.order.service.domain.Schedule;
import com.ulife.utils.config.MessageSender;
import com.ulife.utils.config.Queue;
import com.ulife.utils.config.annotation.EnableDataSourceConfiguration;
import com.ulife.utils.config.annotation.EnableJMSSender;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;

import javax.annotation.Resource;

/**
 * Created by Ulife on 2015/12/29.
 */
@SpringBootApplication
@ComponentScan("com.ulife")
@EnableDataSourceConfiguration
@ImportResource(locations = "order-service-provider.xml")
@EnableJMSSender(queue = Queue.GROUP_ORDERE_PAID)
public class Application implements CommandLineRunner {

    @Resource
    MessageSender messageSender;

//    @Resource
//    Schedule schedule;

    @Override
    public void run(String... strings) throws Exception {

        int length = System.in.read();
        while(length != 99){
            length = System.in.read();
        }
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);

        System.out.println("order service booted!");
    }
}
